class Collection<T>{
    data:T[] = [];
    public push(...items:T[]){
        this.data.push(...items);
    }
    public shift(){
        return this.data.shift();
    }
}

const strCollection = new Collection<string>();
strCollection.push('a','b');
console.log(strCollection.shift());

const numCollection = new Collection<number>();
numCollection.push(1,2);
console.log(numCollection.shift());


type User = {
    name:string
    age:number
};
const hd:User = {
    name:"后盾人",
    age:18
};
const xia:User = {
    name:"xiaxia",
    age:16
};
const userCollection = new Collection<User>();
userCollection.push(hd,xia);
console.log(userCollection.shift());